package com.ubireality.module.patronus;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;

import com.ubireality.module.basic.BaseEntity;
import com.ubireality.module.effect.Behavior;
import com.ubireality.module.effect.BodyParticle;
import com.ubireality.module.effect.Color;

//this class is to control the different branch of Patrons
//will be inheritance by PatronSpecies
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
// single table will be the default setting
public class PatronBranch extends BaseEntity {

	private String branchName;
	private String branchDesc;// the description of this branch
	private String version;// new at which version
	@OneToMany
	private Set<Behavior> availableBehaviors; // the effects depends on
												// different branch
	@OneToMany
	private Set<BodyParticle> availableBodyParticles;
	@OneToMany //TODO what if one of the color was removed by somewhere, will this set still point to the unexist element? 
	private Set<Color> availableColors;

	public PatronBranch() {
		super();
	}

	public PatronBranch(PatronBranch patronBranch) {
		super();
		this.branchName = patronBranch.branchName;
		this.branchDesc = patronBranch.branchDesc;
		this.version = patronBranch.version;
		this.availableBehaviors = patronBranch.availableBehaviors;
		this.availableBodyParticles = patronBranch.availableBodyParticles;
		this.availableColors = patronBranch.availableColors;
	}

	public PatronBranch(String branchName, String branchDesc, String version,
			Set<Behavior> availableBehaviors,
			Set<BodyParticle> availableBodyParticles, Set<Color> availableColors) {
		super();
		this.branchName = branchName;
		this.branchDesc = branchDesc;
		this.version = version;
		this.availableBehaviors = availableBehaviors;
		this.availableBodyParticles = availableBodyParticles;
		this.availableColors = availableColors;
	}

	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public String getBranchDesc() {
		return branchDesc;
	}

	public void setBranchDesc(String branchDesc) {
		this.branchDesc = branchDesc;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public Set<Behavior> getAvailableBehaviors() {
		return availableBehaviors;
	}

	public void setAvailableBehaviors(Set<Behavior> availableBehaviors) {
		this.availableBehaviors = availableBehaviors;
	}

	public Set<BodyParticle> getAvailableBodyParticles() {
		return availableBodyParticles;
	}

	public void setAvailableBodyParticles(
			Set<BodyParticle> availableBodyParticles) {
		this.availableBodyParticles = availableBodyParticles;
	}

	public Set<Color> getAvailableColors() {
		return availableColors;
	}

	public void setAvailableColors(Set<Color> availableColors) {
		this.availableColors = availableColors;
	}

}
